package com.goddess.yeecolor.view;

import android.os.Build;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.WindowManager;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.goddess.yeecolor.R;
import com.goddess.yeecolor.base.BaseActivity;
import com.goddess.yeecolor.tools.SharePreceUtils;

public class ImageShower extends BaseActivity {

	private ImageView img;
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
			//透明状态栏
			getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
			//透明导航栏 一些手机如果有虚拟键盘的话,虚拟键盘就会变成透明的,挡住底部按钮点击事件所以,最后不要用
			//getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
		}
		setContentView(R.layout.imageshower);
		img= (ImageView) findViewById(R.id.img);
		final ImageLoadingDialog dialog = new ImageLoadingDialog(this);
		dialog.setCanceledOnTouchOutside(false);
		dialog.show();
		Glide.with(ImageShower.this)
				.load(SharePreceUtils.getOther("user","thumb"))
				.diskCacheStrategy(DiskCacheStrategy.RESULT)
				.fitCenter()
				.dontAnimate()
				.placeholder(R.mipmap.pic1024)
				.error(R.mipmap.pic1024)
				.into(img);
		dialog.dismiss();

	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {

		finish();
		ImageShower.this.overridePendingTransition(0,0);
		return true;
	}

	@Override
	public void initOnClck() {

	}

	@Override
	public void initFindView() {

	}

	@Override
	public void initData() {

	}
}
